package com.ganzalang.gmall.dubboconsumerservice.controller;

import com.ganzalang.gmall.dubboconsumerapi.dto.UserDTO;
import com.ganzalang.gmall.dubboconsumerservice.service.UserService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.server.PathParam;

/**
 * @author Ganzalang
 * @description
 * @Date 2021/8/2 22:46
 */
@RestController
@RequestMapping("/api/v1/user")
@Slf4j
@RequiredArgsConstructor
public class UserController {

    private final UserService userService;

    @GetMapping("/{name}")
    public UserDTO getUserInfo(@PathVariable("name") String name) {
        UserDTO userInfo = new UserDTO();
        userInfo = userService.getUserInfo(name);
        return userInfo;
    }


}
